		
		* Table A10
		* DiD Estimates of the Impact of SFRs on Educational Attainment

		
		clear all
		set more off
	
		use "C:\Users\EAsker\Desktop\ABR\data\ABR_final_data"
		
		****Baseline controls
		replace fam_inc=. if fam_inc==99|fam_inc==97|fam_inc==0
		gen ln_fam_inc=log(fam_inc)
		
		gen miss_mot_hs=1 if mot_hs==.
		replace miss_mot_hs=0 if mot_hs~=.
		replace mot_hs=0 if mot_hs==.
	
		gen miss_fat_hs=1 if fat_hs==.
		replace miss_fat_hs=0 if fat_hs~=.
		replace fat_hs=0 if fat_hs==.
	   
		gen miss_fam_inc=1 if ln_fam_inc==.
		replace miss_fam_inc=0 if ln_fam_inc~=.
		replace ln_fam_inc=0 if ln_fam_inc==.
	
		gen miss_female=1 if female==.
		replace miss_female=0 if female~=.
		replace female=0 if female==.
	    sort  survey wave sch_id
		
		gen miss_not_white=1 if not_white==.
		replace miss_not_white=0 if not_white~=.
		replace not_white=0 if not_white==.
		
		egen m_weight=mean(weight), by(survey wave sch_id) 
	    replace weight=m_weight if (weight==.|weight==0)&m_weight~=0	
		
		gen log_income=log(income)
		
		gen income_0=income
		replace income_0=. if income_0==0
		
		gen treat_trend=CSFR_BHJ* exposure_year_BHJ


		local controls_civic " miss_mot_hs miss_fat_hs miss_fam_inc miss_not_white miss_female mot_hs fat_hs ln_fam_inc not_white female "
		
		
		foreach y of varlist high_school post_scndry {
	   	
		reghdfe `y'  treat_trend CSFR_BHJ  `controls_civic' if wave==2&qrdinc80_b~=4 , ///
		absorb (fipst year) cluster (fipst) 
		
		outreg2 using "C:\Civic\ABR\output_2_15_24\Table_A10.xls", ///
		append ctitle(`y') bdec(4) sdec(4) nonotes nocons ///
		keep(treat_trend CSFR_BHJ mot_hs fat_hs ln_fam_inc not_white female) ///
		addtext(Control, YES, State FE, YES, Year FE, YES) 
				 
	}
	
	

	
	
	
	
	
	
	